//-
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

include /app/helpers/jade/mixins

.modal.modal--ignite.theme--ignite.center(tabindex='-1' role='dialog')
    .modal-dialog(ng-switch='ctrl.status')
        .modal-content(ng-switch-when='agentMissing')
            .modal-header.header
                h4.modal-title
                    span Connection to Ignite Web Agent is not established
            .modal-body.agent-download
                p Please download and run #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] to use this functionality:
                    ul
                        li Download and unzip #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] archive
                        li Run shell file #[b ignite-web-agent.{sh|bat}]
                p Refer to #[b README.txt] in the ignite-web-agent folder for more information.
                .modal-advanced-options
                    i.fa(ng-class='showToken ? "fa-chevron-circle-down" : "fa-chevron-circle-right"' ng-click='showToken = !showToken')
                    a(ng-click='showToken = !showToken') {{showToken ? 'Hide security token...' : 'Show security token...'}}
                div(ng-show='showToken')
                    +form-field__text({
                        label: 'Security Token:',
                        model: 'ctrl.securityToken',
                        tip: 'The security token is used for authentication of web agent',
                        name: '"securityToken"'
                    })(
                        autocomplete='security-token'
                        ng-disabled='::true'
                        copy-input-value-button='Copy security token to clipboard'
                    )

            .modal-footer
                div
                    button.btn-ignite.btn-ignite--link-success(ng-click='ctrl.back()') {{::ctrl.backText}}
                    a.btn-ignite.btn-ignite--success(href='/api/v1/downloads/agent' target='_self') Download agent

        .modal-content(ng-switch-when='nodeMissing')
            .modal-header.header
                h4.modal-title
                    i.fa.fa-download
                    span Connection to cluster was lost or can't be established

            .modal-body.agent-download
                p Connection to Ignite Web Agent is established, but agent failed to connect to cluster
                p Please check the following:
                p
                    ul
                        li Ignite Grid is up and Ignite REST server started (copy "ignite-rest-http" folder from libs/optional/ to libs/)
                        li In agent settings check URI for connect to Ignite REST server
                        li Check agent logs for errors
                        li Refer to #[b README.txt] in the ignite-web-agent folder for more information.

            .modal-footer
                div
                    button.btn-ignite.btn-ignite--link-success(ng-click='ctrl.back()') {{::ctrl.backText}}
